package com.bweab.controll.userstbcontrol;

import com.bweab.service.api.UsersTbServiceInterface;
import com.bweab.service.impl.UsersTbServiceInterfaceImpl;
import com.bweab.util.JSONResult;
import com.bweab.util.WebUtil;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;
@WebServlet("/adminDeleteUserInfoByUserId")
public class AdminDeleteUserInfoByUserId extends HttpServlet {
    //创建服务对象

    UsersTbServiceInterface usersTbService =new UsersTbServiceInterfaceImpl();
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //获取用户信息
        int userId = Integer.parseInt(req.getParameter("userId"));

        JSONResult jsonResult= usersTbService.adminDeleteUserInfoByUserId(userId);

        WebUtil.writeJson(resp,jsonResult);
    }
}
